package com.qtjf.qtmoneyservice.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.qtjf.qtmoneyservice.R;
import com.qtjf.qtmoneyservice.activity.HelpCenterActivity;
import com.qtjf.qtmoneyservice.activity.JiekuaningActivity;
import com.qtjf.qtmoneyservice.activity.SettingActivity;
import com.qtjf.qtmoneyservice.activity.TongZhiActivity;
import com.qtjf.qtmoneyservice.activity.YouHuiActivity;


public class MyselfFragment extends Fragment {


    LinearLayout settingLayout;
    LinearLayout helpCenterLayout;
    LinearLayout jiLuLayout;
    LinearLayout huoDongLayout;
    LinearLayout youHuiLayout;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_myself, container, false);

        initView(view);
        initData();
        initEvent();

        return view;
    }

    private void initView(View view) {
        settingLayout= (LinearLayout) view.findViewById(R.id.setting_layout);
        helpCenterLayout= (LinearLayout) view.findViewById(R.id.help_center_layout);
        jiLuLayout= (LinearLayout) view.findViewById(R.id.jilu_layout);
        huoDongLayout= (LinearLayout) view.findViewById(R.id.huodong_layout);
        youHuiLayout= (LinearLayout) view.findViewById(R.id.youhui_layout);

    }

    private void initData() {

    }

    private void initEvent() {

        settingLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(getContext(), SettingActivity.class));
            }
        });

        helpCenterLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(getContext(), HelpCenterActivity.class));
            }
        });

        jiLuLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(getContext(), JiekuaningActivity.class));
            }
        });

        huoDongLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(getContext(), TongZhiActivity.class));
            }
        });

        youHuiLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(getContext(), YouHuiActivity.class));
            }
        });

    }

}
